package com.yunduansing.demo.service.impl;

import com.yunduansing.demo.entity.UserRoleEntity;
import com.yunduansing.demo.mapper.UserRoleMapper;
import com.yunduansing.demo.service.UserRoleService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author yunduansing
 * @since 2020-05-24
 */
@Service
public class UserRoleServiceImpl extends ServiceImpl<UserRoleMapper, UserRoleEntity> implements UserRoleService {

    @Override
    public boolean deleteByUserId(int userId) {
        var wrapper=new QueryWrapper<UserRoleEntity>();
        wrapper.eq("user_id", userId);

        return remove(wrapper);
    }

}
